import {getZzDetail} from '../../../utils/api/module/task.js'
import config from '../../../config';

Page({
    data: {
        URL: config._URL_,
        // 轮播图
        lunbotu:{
            background: [],
            indicatorDots: false,
            vertical: false,
            autoplay: true,
            interval: 3000,
            duration: 500,
            circular: true,
            swiperCurrent: 0
        },
        detailInfo:{
            title:"光合空间—工位出租",
            price:"300-600",
            useArea: "0-1000",
            paceFloor:"5层",
            normFloor: "46",
            kfShang:"北京新华阳光资产管理有限公司",
            wuye: "北京新华阳光资产管理有限公司自有物业",
            local: "朝阳区十里河大羊坊路85号",
            bus:"28路、378路、439路、638路、976路、986路、快速直达专线",
            subway:"距离十里河地铁站1294米",
            phone: "17600957706"
        }
    },
    onLoad: function (options) {
        console.log(options);
        this.getDetailInfo(options.id)
    },
    /**
     * l轮播图current设置
     * @param e 参数
     */
    swiperChange(e){
        this.setData({
            ["lunbotu.swiperCurrent"]: e.detail.current
        })
    },
    getDetailInfo(id){
        getZzDetail({
            id: id
        }).then(res => {
            let imgs= [res.data.data.pic]
            this.setData({
                ["lunbotu.background"]:imgs,
                detailInfo: res.data.data,
            })
            console.log(res);
        })
    }
});